#define _CRT_SECURE_NO_WARNINGS 1

#include"list.h"

void test_list1()
{
	sbh::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);

	lt.print();
}

void test_list2()
{
	sbh::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);

	sbh::list<int> lt2(lt1.begin(), lt1.end());
	sbh::list<int> lt3(6,6);

	lt1.print();
	lt2.print();
	lt3.print();
}

void test_list3()
{
	sbh::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_back(5);
	lt1.push_back(6);

	lt1.print();

	lt1.pop_back();
	lt1.pop_back();
	lt1.pop_back();

	lt1.print();
}

void test_list4()
{
	sbh::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_front(4);
	lt1.push_front(5);
	lt1.push_front(6);

	lt1.print();

	lt1.pop_back();
	lt1.pop_back();
	lt1.pop_front();
	lt1.pop_front();

	lt1.print();
}

void test_list5()
{
	sbh::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);

	sbh::list<int> lt2;
	lt2.push_back(4);
	lt2.push_back(5);
	lt2.push_back(6);

	lt1.print();
	lt2.print();

	lt1.swap(lt2);
	cout << endl;

	lt1.print();
	lt2.print();
}

void test_list6()
{
	sbh::list<int> lt1;
	sbh::list<int> lt2;

	lt1.push_back(1);

	cout <<"lt1:" << lt1.empty() << endl;
	cout <<"lt2:" << lt2.empty() << endl;
}

void test_list7()
{
	sbh::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_back(5);
	lt1.push_back(6);

	cout << lt1.front() << endl;
	cout << lt1.back() << endl;
}

void test_list8()
{
	sbh::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_back(5);
	lt1.push_back(6);

	sbh::list<int> lt2(lt1);
	sbh::list<int> lt3;
	lt3 = lt1;

	lt1.print();
	lt2.print();
	lt3.print();

}
int main()
{
	test_list8();

	return 0;
}